#pragma once
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>
#include<time.h>


#define HPDataType int


typedef struct Heap
{
	HPDataType* a;
	int size;
	int capacity;
}HP;


void HeapPrint(HP* php);


void HeapInit(HP* php);


void HeapDestroy(HP* php);


void Swap(HPDataType* p1, HPDataType* p2);


void AdjustUp(HPDataType* a, int child);


void HeapPush(HP* php, HPDataType x);


void AdjustDown(HPDataType* a, int n, int parent);


void HeapPop(HP* php);


HPDataType HeapTop(HP* php);


bool HeapEmpty(HP* php);


int HeapSize(HP* php);